package com.tianqi.modules.pms.controller;


import com.tianqi.common.api.CommonResult;
import com.tianqi.modules.pms.dto.request.ConsultingFeeRequestDTO;
import com.tianqi.modules.pms.dto.response.ConsultingFeeResponseDTO;
import com.tianqi.modules.pms.service.PmsConsultingFeeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * <p>
 * 咨询费用计算依据表 前端控制器
 * </p>
 *
 * @author rory
 * @since 2022-10-04
 */
@RestController
@RequestMapping("/pms/pmsConsultingFee")
public class PmsConsultingFeeController {

	@Resource
	private PmsConsultingFeeService pmsConsultingFeeService;

	/**
	 * 咨询费计算
	 *
	 * @param consultingFeeRequestDTO
	 * @return {@link CommonResult< BigDecimal>}
	 * @author zhangzedi
	 * @date 2022/10/4 10:58
	 */
	@ApiOperation(value = "咨询费用计算")
	@RequestMapping(value = "/calculation", method = RequestMethod.POST)
	public CommonResult<ConsultingFeeResponseDTO> calculationFee(@RequestBody @Validated ConsultingFeeRequestDTO consultingFeeRequestDTO) {
		return pmsConsultingFeeService.calculationFee(consultingFeeRequestDTO);
	}
}

